<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="h" uri="/hd-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查询客户档案</title>
<link href="style/main.css" rel="stylesheet" type="text/css"/>
<link  href="style/glowtabs.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="js/jquery-1.2.6.js"></script>

</head>

<body class="body_content">
<div id="wrap">
	<div id="main" class="clearfix">

<jsp:include page="../header.jsp"></jsp:include>

<div class="ricoh_content_k">
	<div class="ricoh_title">--- 查询客户档案 --- </div>
	<div class="ricoh_content_in">
   		<div class="find_k">
   			<form action="trans_listTransations.action" method="post">
	       	  <div class="find_kd">&nbsp;&nbsp;&nbsp;客户名称：
	            <s:select list="customers" name="customerId" id="customerId" listKey="customerId" listValue="%{unitName}" headerKey="" headerValue="请选择客户" theme="simple"></s:select>
	          </div>
	          
	          <div class="find_kd" style="float:left">合同开始日：
	                	  <input name="contractStartDate" type="text" id="contractStartDate" class="Wdate" onclick="WdatePicker()" readonly="readonly" size="21"
							onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})" value="${contractStartDate}"></input>
	          </div>
	          <div class="find_kd" >&nbsp;&nbsp;合同到期日：
	                      <input name="contractEndDate" type="text" id="contractEndDate" class="Wdate" onclick="WdatePicker()" readonly="readonly" size="21"
							onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})" value="${contractEndDate}"></input>
	          </div>
	          
	          <div class="find_kd">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;维修员：
	          		<s:select list="maintenanceMen" name="purchaseRecord.repairman" id="repairman" listKey="name" listValue="%{name}" headerKey="" headerValue="请选择" theme="simple"></s:select>
	          </div>
	          
	          <div class="find_kd" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机型：
	          		<s:select list="machines" name="purchaseRecord.machineModel" id="machineModel" listKey="machineId" listValue="%{machineModel}" headerKey="" headerValue="请选择机型" theme="simple"></s:select>
	          </div>
	          
	          <p style="padding-top:2px; padding-left:50px;"><input type="submit" name="Submit" value="查询"  class="send_btn"/></p>
	        </form>
        </div>
        
        <div class="find_result">
        <table class="result">
			<caption>查询结果：</caption>
			<thead>
				<tr>
					<th width="18%">客户名称</th>
				    <th width="12%">联系方式</th>
					<th width="25%">机型型号</th>
					<th width="12%">机器序号</th>
					<th width="13%">签约形态</th>
					<th width="10%">合同开始日</th>
                    <th width="10%">合同到期日</th>
				</tr>
			</thead>	
			<tfoot>
				<tr>
					<th>总共:${purchaseRecords.totalCount }条记录</th>
					<td colspan="6">
						<h:pages currentPage="%{currentPage}" url="trans_listTransations.action" totalPage="%{totalPage}" cssClass="pagnation" showPageNumber="3">
							<s:param name="customerId" value="customerId"></s:param>
							<s:param name="contractStartDate" value="contractStartDate"></s:param>
							<s:param name="contractEndDate" value="contractEndDate"></s:param>
							<s:param name="purchaseRecord.repairman" value="purchaseRecord.repairman"></s:param>
							<s:param name="purchaseRecord.machineModel" value="purchaseRecord.machineModel"></s:param>
						</h:pages>
					</td>
				</tr>
			</tfoot>
			<tbody>
				<s:iterator value="purchaseRecords.data" status="purchaseRecord">
					<s:if test="(#customer.index)%2 == 1">
						<tr >
							<th>${customer.unitName}</th>
							<td>${contactWay}</td>
							<td>${machineModel}</td>
							<td>${machineNo}</td>
							<td>${signingForm}</td>
							<td>${contractStartDate}</td>
		                    <td>${contractEndDate}</td>
						</tr>
					</s:if>
					<s:else>
						<tr class="odd">
							<th>${customer.unitName}</th>
							<td>${contactWay}</td>
							<td>${machineModel}</td>
							<td>${machineNo}</td>
							<td>${signingForm}</td>
							<td>${contractStartDate}</td>
		                    <td>${contractEndDate}</td>
						</tr>
					</s:else>					
				</s:iterator>
			</tbody>		
		</table>
        </div>
  </div>
</div>

</div>
</div>

<jsp:include page="../footer.jsp"></jsp:include>

</body>
<script type="text/javascript" src="js/ddtabmenu.js"></script>
<script type="text/javascript">
	ddtabmenu.definemenu("ddtabs2", 4)

</script>
</html>